package com.nbsaas.boot.shop.rest.resource;

import com.nbsaas.boot.shop.api.apis.ShopBannerPositionApi;
import com.nbsaas.boot.shop.data.entity.ShopBannerPosition;
import com.nbsaas.boot.shop.api.domain.request.ShopBannerPositionRequest;
import com.nbsaas.boot.shop.api.domain.response.ShopBannerPositionResponse;
import com.nbsaas.boot.shop.api.domain.simple.ShopBannerPositionSimple;
import com.nbsaas.boot.shop.rest.convert.ShopBannerPositionSimpleConvert;
import com.nbsaas.boot.shop.rest.convert.ShopBannerPositionEntityConvert;
import com.nbsaas.boot.shop.rest.convert.ShopBannerPositionResponseConvert;
import com.nbsaas.boot.shop.data.repository.ShopBannerPositionRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   广告位-业务接口实现
*/
@Transactional
@Service
public class ShopBannerPositionResource extends BaseResource<ShopBannerPosition,ShopBannerPositionResponse, ShopBannerPositionSimple, ShopBannerPositionRequest>  implements ShopBannerPositionApi {

    @Resource
    private ShopBannerPositionRepository shopBannerPositionRepository;

    @Override
    public JpaRepositoryImplementation<ShopBannerPosition, Serializable> getJpaRepository() {
        return shopBannerPositionRepository;
    }

    @Override
    public Function<ShopBannerPosition, ShopBannerPositionSimple> getConvertSimple() {
        return new ShopBannerPositionSimpleConvert();
    }

    @Override
    public Function<ShopBannerPositionRequest, ShopBannerPosition> getConvertForm() {
        return new ShopBannerPositionEntityConvert();
    }

    @Override
    public Function<ShopBannerPosition, ShopBannerPositionResponse> getConvertResponse() {
        return new ShopBannerPositionResponseConvert();
    }




}


